﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Kira.Compiler.Bods
{
    [XmlElementMapping("DITransformCall", "name", "Reverse_Pivot")]
    public class UnPivot : BodsTransform
    {
        public String InputName
        {
            get
            {
                return this.GetElement("DIInputView").GetAttrbuteValue("name");
            }
        }

        public String OutputName
        {
            get
            {
                return this.GetElement("DISchema").GetAttrbuteValue("name");
            }
        }
        public IEnumerable<DIElement> Columns
        {
            get
            {
                return this.GetElement("DISchema").GetElements<DIElement>();
            }
        }

        public override IEnumerable<string> InputNames
        {
            get { return new String[] { this.InputName}; }
        }

        public override IEnumerable<string> OutputNames
        {
            get { return new String[] { this.OutputName }; }
        }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append(GetComments("Reverse_Pivot"));
            sb.AppendLine("--Reverse_Pivot not supported");

            return sb.ToString();
        }
    }
}
